package com.linkage.lcims.base.dao.business.impl;

import java.util.List;
import java.util.Map;

import com.linkage.lcims.base.dao.HibernateBaseDAOImpl;
import com.linkage.lcims.base.dao.business.interfaces.DomainDAO;
import com.linkage.lcims.base.po.business.BdAuthtype;
import com.linkage.lcims.base.po.business.BdAuthtypePK;
import com.linkage.util.exception.DAOException;

public class DomainDAOImpl extends HibernateBaseDAOImpl implements DomainDAO {

	private static final String PO_CLASS = "com.linkage.lcims.base.po.business.BdAuthtype";

	private static final String PK_CLASS = "com.linkage.lcims.base.po.business.BdAuthtypePK";

	@SuppressWarnings("unchecked")
	public List<BdAuthtype> getAll() throws DAOException {
		return this.getAll(BdAuthtype.class);
	}

	public BdAuthtype getDomain(String name,
			Integer nameType, Integer accessType) throws DAOException {
		BdAuthtypePK pk = new BdAuthtypePK(name, nameType, accessType);
		BdAuthtype bdAuthtype = (BdAuthtype) this.getByID(PO_CLASS, pk);
		return bdAuthtype;
	}

	public void saveDomain(BdAuthtype bdAuthtype) throws DAOException {
		this.save(bdAuthtype);
	}

	public void deleteDomain(BdAuthtype bdAuthtype) throws DAOException {
		this.delete(BdAuthtype.class, bdAuthtype.getComp_id());

	}

	public void updateDomain(BdAuthtype bdAuthtype) throws DAOException {
		this.merge(bdAuthtype);
	}

	@SuppressWarnings({ "unchecked", "static-access" })
	public void updateDaomainFileds(Map keys,Map<String,?> fileds) throws DAOException {
		super.updateField(this.PO_CLASS, this.PK_CLASS,keys,fileds);
	}

	
}
